package com.icss.dao;

import org.apache.ibatis.jdbc.SQL;

import com.icss.entity.Review;



public class ReviewBeanPriv {
	public String selectReview(final Review review) {
		SQL s1=new SQL(){{
			SELECT("review. * ,reviewclass.Reviewclassname,custom.c_name,menu.DishName");
			FROM("review,reviewclass,custom,menu");
			WHERE("menu.DishId=review.DishId and review.c_id=custom.c_id and review.Reviewclassid=reviewclass.Reviewclassid");
			if (review.getReviewclassid()!=null) {
				WHERE("review.Reviewclassid=#{Reviewclassid}");
			}
			if(review.getDishName()!=null)
			{
			WHERE("DishName like CONCAT('%', #{DishName} , '%')");
			}
		}};
		return s1.toString();
	}
}
